<?
// class.factorial.php
class factorial
{
   private $result = 1;// Inicjalizacj mona przeprowadzi bezporednio z zewntrz.
   private $number;
   function __construct($number)
   {
      $this->number = $number;
      for($i=2; $i<=$number; $i++)
      {
         $this->result *= $i;
      }
   }
   public function showResult()
   {
      echo "Silnia liczby {$this->number} wynosi {$this->result}. ";
   }
}
?>
